home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1999 / MacHack 1999.toast / The Hacks / OutOfContextMenus / Source / CRebootBehavior.h < prev    next >
Encoding:
Text File  |  1999-06-25  |  1.5 KB  |  73 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    CRebootBehavior.h                 ©1999 Eric Traut
  3. // ===========================================================================
  4.  
  5. #pragma once
  6.  
  7. #include "COffscreenBehavior.h"
  8.  
  9.  
  10. typedef UInt16    RebootState;
  11. enum
  12. {
  13.     kRebootStateBlackScreen        = 0,
  14.     kRebootStateBootBeep,
  15.     kRebootStateGrayScreen,
  16.     kRebootStateHappyMac,
  17.     kRebootStateMacOSScreen,
  18.     kRebootStateInit,
  19.     kRebootStateTearDown
  20. };
  21.  
  22. enum
  23. {
  24.     kTotalINITIcons                = 5
  25. };
  26.  
  27. class CRebootBehavior : public COffscreenBehavior
  28. {
  29.     public:
  30.         CRebootBehavior(CShadowWindow &        inShadowWindow);
  31.  
  32.         virtual Boolean
  33.         RenderToGWorld(    StGWorldLocker &        inRenderingLocker);
  34.  
  35.         virtual void
  36.         DoIdleTask(    Boolean     inGNETime);
  37.  
  38.         UInt32
  39.         GetTicksForState(RebootState inState);
  40.         
  41.         static void
  42.         Initialize(    SndChannelPtr inSoundChannel);
  43.         
  44.     protected:
  45.         void
  46.         DrawMacOSScreen(    ConstStr255Param    inMsgString,
  47.                             UInt32                inTicksSinceStart,
  48.                             UInt32                inINITsToDraw);
  49.  
  50.         void
  51.         CenterRect(        const Rect &        inBounds,
  52.                         Rect &                outCenterRect,
  53.                         SInt16                inBoxWidth,
  54.                         SInt16                inBoxHeight);
  55.  
  56.     private:
  57.         RebootState                    mCurRebootState;
  58.         UInt32                        mTicksInState;
  59.         UInt32                        mTicksStateStarted;
  60.         
  61.         static PixPatHandle            sBackgroundPixPat;
  62.         static PicHandle            sMacOSPicture;
  63.         static PicHandle            sProgressPicture;
  64.         static PicHandle            sSliderPicture;
  65.         static CIconHandle            sHappyMacIcon;
  66.         static IconSuiteRef            sInitIcons[kTotalINITIcons];
  67.         static SndListHandle        sBootBeepSound;
  68.         static SndChannelPtr        sSndChannel;
  69. };
  70.  
  71.  
  72.  
  73.